using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_SubSystemMap : EntityTypeConfiguration<t_SubSystem>
    {
        public t_SubSystemMap()
        {
            // Primary Key
            this.HasKey(t => t.FSubSysID);

            // Properties
            this.Property(t => t.FSubSysID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNumber)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FName_cht)
                .HasMaxLength(80);

            this.Property(t => t.FName_en)
                .HasMaxLength(80);

            // Table & Column Mappings
            this.ToTable("t_SubSystem");
            this.Property(t => t.FSubSysID).HasColumnName("FSubSysID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FName_cht).HasColumnName("FName_cht");
            this.Property(t => t.FName_en).HasColumnName("FName_en");
        }
    }
}
